package com.thirteen.app.service.impl;

import com.thirteen.app.daoTest.UserDao;
import com.thirteen.app.entity.User;
import com.thirteen.app.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service

public class UserServiceImpl implements UserService {
    @Resource
    private UserDao userDao;

    @Override
    public List<User> getuserPageList(Integer pageIndex, Integer pageSize, Integer role, String userName) {
        return userDao.getuserPageList((pageIndex - 1) * pageSize, pageSize, role, userName);
    }

    @Override
    public int userCount(Integer role, String userName) {
        return userDao.userCount(role, userName);
    }

    @Override
    public int UpdateUser(User user) {
        return userDao.UpdateUser(user);
    }

    @Override
    public int deleteById(Integer userid) {
        return userDao.deleteById(userid);
    }

    @Override
    public User queryById(Integer userid) {
        return userDao.queryById(userid);
    }

    @Override
    public User login(User user) {
        return userDao.login(user.getUserName(), user.getPassWord());
    }

    @Override
    public int updateUserAddress(User user) {
        return userDao.UpdateUser(user);
    }

   /* @Override
    public List<Logs> getUserEventPageList(Integer pageIndex, Integer pageSize, Integer userid) {
        return userDao.getUserEventPageList((pageIndex-1)*pageSize,pageSize,userid);
    }*/
}
